package example;
import facecat.FaceCatScript;
import facecat.topin.core.*;
import facecat.topin.xml.*;
import facecat.topin.tab.*;
import facecat.topin.input.*;
import facecat.topin.btn.*;

/*
 * 日期选择示例
 */
public class DatePickerExample extends FCUIXml implements FCTouchEventCallBack
{
    /*
     * 加载Xml
     * @param fileName 文件名
     * @param view 视图名称
     */
   public void loadXml(String fileName, FCView view)
   {
       setScript(new FaceCatScript(this));
       super.loadXml(fileName, view);
       //获取第二页
       FCTabPage tabPage = getTabPage("TabPage2");
       FCDateTimePicker datePicker2 = new FCDateTimePicker();
       datePicker2.setLocation(new FCPoint(100, 100));
       datePicker2.setSize(new FCSize(100, 20));
       tabPage.addView(datePicker2);

       FCButton button1 = getButton("Button");
       button1.addEvent(this, FCEventID.Click, this);
   }

    /*
     * 点击事件
     * @param eventName 事件ID
     * @param sender 发送者
     * @param touchInfo 触摸信息
     * @param invoke 引用者
     */
    public void callTouchEvent(String eventName, Object sender, FCTouchInfo touchInfo, Object invoke)
    {
        FCDateTimePicker datePicker = (FCDateTimePicker)findView("DatePicker");
        String text = datePicker.getText();
    }
}